﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Samples
{
    public static class Helper
    {
        public static void ChangeClockWise<T>(T[] data)
        {
            if (data.Length % 3 != 0)
                throw new ArgumentException("Lenght of data must be multiple of 3");
            for (int i = 0; i < data.Length; i += 3)
            {
                T t = data[i];
                data[i] = data[i + 2];
                data[i + 2] = t;
            }
        }
        public static void ChangeZToY<T>(T[] data)
        {
            if (data.Length % 3 != 0)
                throw new ArgumentException("Lenght of data must be multiple of 3");
            for (int i = 0; i < data.Length; i += 3)
            {
                T t = data[i + 1];
                data[i + 1] = data[i + 2];
                data[i + 2] = t;
            }
        }
    }
}
